{include file="public/head"}
{include file="public/left"}
<!-- content -->
<div class="main_02_r">

    <!--内容区域-->
    <div class="site_01">
        <span>当前位置：</span><a href="#">城事社</a><i>></i><a href="#">基本服务</a>
    </div>

    <div class="nrq_01">
        <div class="gg_01">
            <span><a href="{:url('basic/service')}">客服</a></span><span><a href="{:url('basic/advice')}">投诉建议</a></span><span><a href="{:url('basic/aboutUs')}">关于我们</a></span><span class="on">技术服务</span>
        </div>
        <div class="gg_02">
            <div class="gg_03">


                <div class="szfy_01">
                    <form class="ajax_form" action="{:url('basic/ajax_submit_insert')}">
                    <p class="p1">
                        <em>
                            <input type="hidden" name="setting_type" value="2"/>
                            <textarea class="description" name="description" rows="1" cols="1"  maxlength="90" placeholder="请输入技术服务内容"></textarea>
                        </em>
                    </p>
                    <p class="p1">
                        <input type="button" value="确定" class="szfy_01_btn ajax_submit" />
                    </p>
                    </form>
                </div>


            </div>
        </div>

    </div>

</div>
<script type="text/javascript">
    $(function(){
        var layer = layui.layer,form = layui.form;
        //添加一级分类
        $(".ajax_submit").click(function(){
            var description = $(".description").val();
            if(description.length > 90){
                layer.msg("技术服务内容长度不能超过20");
                return;
            }
            var url = $('.ajax_form').attr("action")?$('.ajax_form').attr("action"):"{:url()}";
            var data = $('.ajax_form').serialize();
            ajax_psot(url,data);
        });
    })

    function ajax_psot(url,data){
        $.ajax({
            url:url,
            type: "POST",//方法类型
            // dataType: "json",//预期服务器返回的数据类型
            data: data,
            success: function (data) {
                if (data.code === 1) {
                    layer.msg("<span style='margin-left: 18px;'>"+data.msg+"</span>",{icon: 1,time:1000},function(){
                        window.location.href=data.url;
                    });
                }else{
                    layer.msg("<span style='margin-left: 18px;'>"+data.msg+"</span>",{icon: 2,time:1000},function(){
                        /*if(data.url){
                            window.location.href=data.url;
                        }else{
                            location.reload();
                        }*/
                    });
                }
            },
            error : function() {
                layer.msg("<span style='margin-left: 18px;'>请求错误,请联系管理员</span>",{icon: 0,time:1000},function(){
                    //location.reload();
                });
            }
        });
    }
</script>
<!-- content -->
{include file="public/foot"}